/************************************************************
 * Project Name		[Thinking_In_Java]
 * File Name     	[pkg_api_testing.Java_Util_DateFormatSymbols.java]
 * Creation Date 	[15-Jun-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_api_testing;

import java.text.DateFormatSymbols;
import java.util.Arrays;
import java.util.Locale;

/**
 * java.util.DateFormatSymbols
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Java_Util_DateFormatSymbols {

	/**
	 * 获得日期时间的描述
	 */
	public static void getDateTimeSymbols() {
		// 中文环境下完整描述和简要描述无区别, 因此设置为英文环境
		Locale.setDefault(new Locale("en", "US"));
		DateFormatSymbols symbols = DateFormatSymbols.getInstance();
		String[] fullWeekDescriptions = symbols.getWeekdays();
		System.out.println("完整星期描述: " + Arrays.toString(fullWeekDescriptions));
		String[] shortWeekDescriptions = symbols.getShortWeekdays();
		System.out.println("简要星期描述: " + Arrays.toString(shortWeekDescriptions));

		String[] fullMonthDescriptions = symbols.getMonths();
		System.out.println("完整月份描述: " + Arrays.toString(fullMonthDescriptions));
		String[] shortMonthDescriptions = symbols.getShortMonths();
		System.out
				.println("简要月份描述: " + Arrays.toString(shortMonthDescriptions));

		String[] ampmString = symbols.getAmPmStrings();
		System.out.println("上午下午描述: " + Arrays.toString(ampmString));

		System.out.println("纪元描述: " + Arrays.toString(symbols.getEras()));

		// 如果需要自定义显示的星期或月份, 可以使用setMonths(...)/setWeekdays(...)方法
	}

	/**
	 * 测试方法
	 * 
	 * @param args
	 *            命令行参数
	 */
	public static void main(String[] args) {
		Java_Util_DateFormatSymbols.getDateTimeSymbols();
	}
}
